package com.itheima.health.service.impl;

import com.itheima.health.dao.MemberDao;
import com.itheima.health.pojo.Member;
import com.itheima.health.service.MemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 会员SERVICE实现类
 */
@Service
@Slf4j
public class MemberServiceImpl implements MemberService {
    @Autowired
    private MemberDao memberDao;

    /**
     * 根据手机号查询会员信息
     * @param phone
     * @return
     */
    @Override
    public Member selectPhoneNumber(String phone) {
        Member member = memberDao.selectPhonNumber(phone);
        return member;
    }


    /**
     * 根据手机号查询会员为空,需要新建会员,会员信息只有手机号
     * @param newMember
     */
    @Override
    public void addMember(Member newMember) {
        memberDao.addMember(newMember);
    }


}
